﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using JM.JCY.Common;
using NCS.IConnect.PolicyInjection.CallHandlers;
using JM.JCY.BusinessComponent;
using JM.JCY.BusinessEntity;
using JM.JCY.DataAccess;


namespace JM.JCY.BusinessFacade
{


    public class UserManagementBF : JCYBusinessFacadeBase<UserManagementBC>, IUserManagement
    {
        public UserManagementBF()
            : base(new UserManagementBC())
        {
        }

        public DataSetUserManagement.T_DepartmentDataTable GetAllDepartment()
        {
            return this.BusinessComponent.GetAllDepartment();
        }

        public bool UpdateDepartmentSortOrder(string deptName, int sortOrder)
        {
            return this.BusinessComponent.UpdateDepartmentSortOrder(deptName, sortOrder);
        }

        public void UpdateDepartmentSortOrder(DataSetUserManagement.T_DepartmentDataTable dt)
        {
            this.BusinessComponent.UpdateDepartmentSortOrder(dt);
        }

        public DepartmentTitleDataSet.T_DeptTitleDataTable GetDeptTitleList()
        {
            return this.BusinessComponent.GetDeptTitleList();
        }


        public void CreateNewDepartment(DataSetUserManagement ds)
        {
            BusinessComponent.CreateNewDepartment(ds);
        }

        public int IsExistDept(string DeptName)
        {
            return BusinessComponent.IsExistDept(DeptName);
        }

        public bool DelDeptById(int deptId)
        {
            return BusinessComponent.DelDeptById(deptId);

        }

        public DataSetUserManagement.T_JobTitleDataTable GetTitleByDeptId(int deptId)
        {
            return BusinessComponent.GetTitleByDeptId(deptId);
        }

        public DataSetUserManagement GetDepartmentTitleById(int deptId)
        {
            return BusinessComponent.GetDepartmentTitleById(deptId);
        }

        public DataSetUserManagement.T_UserInfoDataTable SearchUserInfo(string name, int deptId, int jobTitleId, string status)
        {
            return BusinessComponent.SearchUserInfo(name, deptId, jobTitleId, status);
        }

        public DepartmentTitleDataSet.T_DeptTitleDataTable GetDeptTitleByUserId(int userId)
        {
            return BusinessComponent.GetDeptTitleByUserId(userId);
        }

        public FrameworkDataset.T_MyCommitteeDataTable GetMyCommittee(string userName)
        {
            return this.BusinessComponent.GetMyCommittee(userName);
        }

        public DataSetUserManagement.T_DepartmentDataTable GetDeptById(int deptId, string deptName)
        {
            return this.BusinessComponent.GetDeptById(deptId, deptName);
        }


        public DataSetUserManagement.T_UserInfoDataTable GetUser(int userId, string userName)
        {
            return this.BusinessComponent.GetUser(userId, userName);
        }

        public DepartmentTitleDataSet.T_DepartmentJobTitleDataTable GetUserDeptTitle(int userId)
        {
            return this.BusinessComponent.GetUserDeptTitle(userId);
        }

        public void UpdateUserDept(DepartmentTitleDataSet.T_UserDepartmentDataTable dt)
        {
            this.BusinessComponent.UpdateUserDept(dt);
        }

        public void UpdateUserJobTitle(DepartmentTitleDataSet.T_UserJobTitleDataTable dt)
        {
            this.BusinessComponent.UpdateUserJobTitle(dt);
        }


        public void UpdateUserInfo(DataSetUserManagement.T_UserInfoDataTable dt)
        {
            this.BusinessComponent.UpdateUserInfo(dt);
        }

        public DepartmentTitleDataSet.T_UserDepartmentDataTable GetUserDeptByUserId(int userId)
        {
            return this.BusinessComponent.GetUserDeptByUserId(userId);
        }

        public DepartmentTitleDataSet.T_UserJobTitleDataTable GetUserJobTiTleByUserId(int userId)
        {
            return this.BusinessComponent.GetUserJobTiTleByUserId(userId);
        }

        public DepartmentTitleDataSet.T_JobTitle_MemberDataTable GetUserJobtitle(int userId, int deptId)
        {
            return this.BusinessComponent.GetUserJobtitle(userId, deptId);
        }

        public DepartmentTitleDataSet.T_Dept_MemberDataTable GetDepartmentMember(int deptId)
        {
            return this.BusinessComponent.GetDepartmentMember(deptId);
        }

        public DepartmentTitleDataSet.T_UserInfo_PersonalDataTable GetUserForHome(int userId)
        {
            return this.BusinessComponent.GetUserForHome(userId);
        }

        public DepartmentTitleDataSet.T_User_Related_DeptDataTable GetUserRelatedDept(string userName)
        {
            return this.BusinessComponent.GetUserRelatedDept(userName);
        }

        public DepartmentTitleDataSet.T_UserDepartmentDataTable GetUserDeptMatch(int userId, int deptId)
        {
            return this.BusinessComponent.GetUserDeptMatch(userId, deptId);
        }

        public DepartmentTitleDataSet.T_User_Dept_DataDataTable GetUserDept(int userId)
        {
            return this.BusinessComponent.GetUserDept(userId);
        }

        // for committee
        public CommitteeDataSet.T_CommitteeDataTable GetCommitteeById(int committeeId)
        {
            return this.BusinessComponent.GetCommitteeById(committeeId);
        }

        public CommitteeDataSet.T_Committee_MemberDataTable GetCommitteeMember(int committeeId)
        {
            return this.BusinessComponent.GetCommitteeMember(committeeId);
        }

        public void UpdateCommittee(CommitteeDataSet.T_CommitteeDataTable dt)
        {
            this.BusinessComponent.UpdateCommittee(dt);
        }

        public void UpdateUserComittee(CommitteeDataSet.T_UserCommitteeDataTable dt)
        {
            this.BusinessComponent.UpdateUserComittee(dt);
        }

        public CommitteeDataSet.T_UserCommitteeDataTable GetUserCommitteeById(int userCommitteeId)
        {
            return this.BusinessComponent.GetUserCommitteeById(userCommitteeId);
        }

        public CommitteeDataSet.T_CommitteeDataTable GetCommitteeByName(string committeeName)
        {
            return this.BusinessComponent.GetCommitteeByName(committeeName);
        }

        public CommitteeDataSet.T_UserCommitteeDataTable GetUserCommitteeMatch(int userId, int committeeId)
        {
            return this.BusinessComponent.GetUserCommitteeMatch(userId, committeeId);
        }

        public DepartmentTitleDataSet.T_UserDepartmentDataTable GetUserDepartmentByDeptId(int deptId)
        {
            return this.BusinessComponent.GetUserDepartmentByDeptId(deptId);
        }

        public void UpdateDepartmentMemeberSortOrder(DepartmentTitleDataSet.T_UserDepartmentDataTable dt)
        {
            this.BusinessComponent.UpdateDepartmentMemeberSortOrder(dt);
        }

        // contact
        public DepartmentTitleDataSet.T_User_ContactDataTable GetUserContactByName(string userName)
        {
           return this.BusinessComponent.GetUserContactByName(userName);
        }

        public DepartmentTitleDataSet.T_User_ContactDataTable GetUserContactForHome(string userName, int count)
        {
            return this.BusinessComponent.GetUserContactForHome(userName, count);
        }

        public DataSetUserManagement.T_UserInfoDataTable GetUserForSystem(int userId)
        {
            return this.BusinessComponent.GetUserForSystem(userId);
        }

        public void CreateDeptMgr(UserInfoDataSet.T_DeptMgrDataTable dt)
        {
            BusinessComponent.CreateDeptMgr(dt);
        }

        public void DeleteDeptMgrByUserName(string userName)
        {
            BusinessComponent.DeleteDeptMgrByUserName(userName);
        }

        public UserInfoDataSet.T_DeptMgrDataTable GetUserDeptMgr(string userName)
        {
            return BusinessComponent.GetUserDeptMgr(userName);
        }

        public void DeleteUserById(int userId)
        {
            BusinessComponent.DeleteUserById(userId);
        }
    }
}


